import React, { Component } from "react";
import {
  BrowserRouter as Router,
  Route,
  Link,
  Redirect,
} from "react-router-dom";
import Page1 from "./Page1";
import Todo from "./Todo/Todo";

export default class App extends Component {
  constructor(props) {
    super(props);

    this.state = {};
  }

  render() {
    return (
      <div>
        <Router>
          <Link to="/page1">页面一</Link>
          <Link to="/todo">todolist</Link>
          <Redirect to="/page1"></Redirect>
          <Route path="/page1" component={Page1}></Route>
          <Route path="/todo" component={Todo}></Route>
        </Router>
      </div>
    );
  }
}
